﻿@using Microsoft.AspNetCore.Identity
@using CSCSN.EntitiyModels
@inject SignInManager<ApplicationUser> SignInManager
@inject UserManager<ApplicationUser> UserManager

    <ul class="navbar-nav">
        @if (SignInManager.IsSignedIn(User))
        {
            <li class="nav-item">
                <a class="nav-link text-dark" asp-area="Identity" asp-page="/Account/Manage/Index" title="Manage">Hello @User.Identity.Name!</a>
            </li>
            @*<li class="nav-item">
                <form class="form-inline" asp-area="Identity" asp-page="/Account/Logout" asp-route-returnUrl="@Url.Action("Index", "Home", new { area = "" })">
                    <button type="submit" class="nav-link btn btn-link text-dark">Logout</button>
                </form>
            </li>*@
            <li>@Html.ActionLink("退出", "Logout", "Account", routeValues: null, htmlAttributes: new { id = "UserID" })</li>
        }
        else
        {


            <li>@Html.ActionLink("注册", "Create", "ApplicationUser", routeValues: null, htmlAttributes: new { id = "UserID" })</li>

            @*<li class="nav-item">
                <a class="nav-link text-dark" asp-area="Identity" asp-page="/Account/Login">Login</a>
            </li>*@
            <li>@Html.ActionLink("登录", "Login", "Account", routeValues: null, htmlAttributes: new { id = "UserID" })</li>
        }
    </ul>
